using System;
using System.Drawing;
using System.Windows.Forms;

namespace gpcx
{
    public partial class CodeDetialUcFrmV : UserControl
    {
        public CodeDetialUcFrmV()
        {
            InitializeComponent();
        }

        public void SetValue(ValueTuple<string, string, string, string, string, string, string> param)
        {
            if (string.IsNullOrEmpty(param.Item6))
            {
                label1.Text = $"{param.Item1}";
                label2.Text = $"{param.Item3}";
                label3.Text = $"{param.Item5}%";
                label3.Font = new Font(label4.Font, FontStyle.Bold);
                label3.ForeColor = param.Item5.StartsWith("-") ? Color.DarkSeaGreen : Color.DarkRed;
                label4.Text = "";
                Height = 44;
            }
            else
            {
                label1.Text = $"{param.Item1}";
                label2.Text = $"{param.Item2}";
                label3.Text = $" {param.Item3}";
                label4.Text = $"{param.Item5}%";
                label4.Font = new Font(label4.Font, FontStyle.Bold);
                label4.ForeColor = param.Item5.StartsWith("-") ? Color.DarkSeaGreen : Color.DarkRed;

                textBox1.Text = param.Item6;
                Height = 88;
            }
        }
    }
}
